Repository navigation
fix(app-shell): an areas-only app lands on its first area entry; a url/action-only app says it opens from its menu - #29849
Conversation
…l/action-only app says it opens from its menu The app root's landing walk read only the top-level navigation, so an app whose entries live only under `areas` opened to an empty main, and an app whose every entry is a `url` or `action` link rendered null. The walk now covers every shown tree in order (working entry first, then doc, across the trees), and the no-landing fallthrough draws AppNoAccessEmptyState with a new `menu-only` reason. AppPreview mirrors the walk. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSW6s8ABou6nBvnfbz
|
Contract-review-claim: session_01QsR2jV5sBSzCYNEDgpYLJw · head d1b4d8e · 2026-11-03T07:30Z Generated by Claude Code |
|
director#1 · zhuangjianguo · session_01QsR2jV5sBSzCYNEDgpYLJw Contract reviewServed-tier: Read-only; nothing built or run. Card #29771 (app root landing across areas; menu-only empty state), the out-of-scope finding of #29678. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix. No should-fix. Implemented-by: VERDICT: PASS Generated by Claude Code |
|
domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m 席位核对 · ACCEPT · 2026-11-03T07:43ZHead-sha:
|
Requested by Steedos · project thread
Fixes #29771
Clause-②: yes
Metadata-protocol: none
维护者速读
ui/packages/app-shell/src/console/AppContent.tsx的resolveLandingRoute/firstRouteAcross(跨全部导航树的落地顺序)和AppRootLanding末尾(原来的return null);ui/packages/app-shell/src/console/AppNoAccessEmptyState.tsx的menu-only分支。pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.docOnlyLanding-29678.test.tsx,应见 13 个用例全绿:只有分区的应用落到分区里的第一个对象,只有链接/动作的应用显示data-reason="menu-only"的空状态,原有对照组照旧。What changes
Claim: issuecomment 6595973888, amended by 6596042756 (declaration lines
Clause-②: yes,Metadata-protocol: none; surface plusAppNoAccessEmptyState.tsxand the ten locale packs).An app whose entries live only under
areas, or whose every entry is aurloractionlink, opened/apps/APPto an emptymain.resolveLandingRoutewalked onlyshownTrees[0](the top-levelnavigation), althoughAppRootLandingalready handed it every shown tree, andAppRootLandingthen renderednull.AppContent.tsx, newfirstRouteAcross). The declared landing first, then the first working entry (object, page, dashboard, report, component) acrossnavigationand eachareas[].navigationin order, then the firstdocentry across the same order. The preference holds across the trees, not per tree: a working entry in any area outranks adocentry in the top-level navigation. That is console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678's rule (a working entry outranks reading material) applied to the app rather than to one tree. The sidebar elects the area that holds the entry the route addresses (electSidebarArea), so a landing in a later area opens with that area active.AppContent.tsx). When nothing lands and the app still shows the member entries, every one of them is aurloractionlink. The root now drawsAppNoAccessEmptyStatewith a newreason="menu-only"instead ofnull.AppNoAccessEmptyState.tsx: themenu-onlyreason has its own title and description (empty.appOpensFromMenu,empty.appOpensFromMenuDescription), a menu icon instead of the lock, and no Setup link even whensetupPathis given, because the member has access. The other two reasons are unchanged.@object-ui/i18n: the two keys in all ten locale packs.AppPreview.tsx:findFirstLandingAcrossnormalizes each area's navigation and walks the trees in the same order, so the designer names the entry the console opens on.appServesNoNavigation.ts: the docblock said the resolver walks the top-level navigation only and that a doc entry does not land; both went stale (console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678, and this PR). Docblock only.AppContent.studioRootLanding-12113.test.tsxpinned, for objectui#12113, that a url-only app "stays on its root, with no empty state and no page" (it assertedapp-no-access-empty-stateabsent). This card makes exactly that blank root the defect, so the case now asserts themenu-onlyempty state; the "stays on its root, no page" half is kept. Seat-approved in the card thread.Tests
AppContent.docOnlyLanding-29678.test.tsx, new top-leveldescribeon the same harness (realAppContent,ExpressionProvider,MePermissionsProvider): an areas-only app lands on the first working entry of its areas; a working entry in an area outranks a top-level doc; a doc in an area lands when no tree holds a working entry; a url/action-only app (group and area included) drawsdata-reason="menu-only"with no Setup link; CONTROL: no shown navigation keepsdata-reason="no-navigation"; CONTROL: a pending read in an area holds the skeleton, then lands. The file's console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678 cases (doc-only lands, object app redirects, no-navigation, pending read) stay as controls.AppNoAccessEmptyState.sharedState-25915.test.tsx:menu-onlyadded to thedata-reasontable; its copy is not the no-access sentence; no Setup link with a setup path.AppPreview.areas-11027.test.tsx: the preview names the area entry for an areas-only app, prefers it over a top-level doc, and CONTROL keeps a top-level working entry first.AppContent.studioRootLanding-12113.test.tsx: the moved pin above.Acceptance notes
navigationand objects in an area opens on the first object.AppNoAccessEmptyState(seat ruling) and keeps itsdata-testid="app-no-access-empty-state";data-reason="menu-only"is what tells it apart. It says nothing about access and offers no Setup link.Clause-②: yes: the two new keys widen@object-ui/i18n's builtdist/locales/en.d.ts(every leaf is a readonly literal and the entry re-exportsenandtype TranslationKeys). Changeset level stayspatchwithMetadata-protocol: none.UnifiedSidebar.tsx), not measured, not changed: when an app has a visible area,UnifiedSidebardraws the active area's tree in place of the top-levelnavigation(activeArea?.navigation || readableAppNavigation). So in an app that has both, a landing on a top-level entry can open a page with no sidebar entry. This PR does not change that; the order here only decides which entry lands./apps/com.example.r29771-landing), which is the existing package-address behaviour for the package's first app.Verification
Final head:
d1b4d8e8(merge oforigin/mainatb0ef25f5).Tests on the final head
On
d1b4d8e8: everyconsole/__tests__/AppContent.*.test.tsxfile,AppNoAccessEmptyState.sharedState-25915.test.tsx, everypreviews/AppPreview*.test.tsxfile andpackages/i18n/: 150/150 files, 1932 passed, 13 skipped.turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 66/66 tasks.Before the main merge (head
fecc3403): the four touched files 4/4, 33/33; the consumer sweep (every ui test file namingAppContent,AppNoAccessEmptyState,AppPreview,appServesNoNavigationor the empty-state keys) 155/155 files, 1305/1305 tests in four locked batches;packages/i18n/95/95 files, 1443 passed, 13 skipped;turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n66/66 tasks;eslinton the touched ui files 0 errors.Ablations (each restored, blob equal to HEAD and git diff HEAD empty, by scripts/ablation-replace.mjs)
resolveLandingRoutewalksshownTrees.slice(0, 1)only:AppContent.docOnlyLanding-29678.test.tsx4 failed, 9 passed (the areas-only, area-over-doc, doc-in-area and pending-in-area cases).return null: 2 failed acrossdocOnlyLanding-29678andstudioRootLanding-12113(both menu-only cases).AppPreviewwalks[navItems]only:AppPreview.areas-11027.test.tsx2 failed, 6 passed.menu-onlybranch made unreachable:AppNoAccessEmptyState.sharedState-25915.test.tsx2 failed, 5 passed.Local gate union
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 35 families onfecc3403; all 35 ran with exit 0 (pnpm --dir ui exec vitest run scripts/: 170 files passed, 2 skipped).--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. Alsonode scripts/check-i18n-en-drift.mjs(fromui/) exit 0: 2 keys added, 0 en values changed. The body gates (check-adr-0087-registration,check-changeset-no-major,check-closing-keyword-parity) ran against this body.Live, showcase --fresh with the Console Vite on source
Four apps published into a scratch package
com.example.r29771-landing: url-only (oneurland oneactionentry), areas-only (navigation: [], first area holds an object entry forshowcase_account, second aurl), doc-only (a doc entry forshowcase_manual), and an object app. Opened at/apps/APPas admin and asauditor.demo@example.com.main(0 chars), admin and auditordata-reason="menu-only", "R29771 Links opens from its menu", admin and auditormain(0 chars), admin and auditor/apps/r29771_areas/showcase_account, the list renders/apps/r29771_doconly/docs/manual/showcase_index/apps/r29771_object/showcase_accountThe before leg swapped only
AppContent.tsxto main under Vite (Vite was confirmed serving main's module), then restored it (blob equal to HEAD). The after shots were taken before the swap. Shots: desktop for both personas plus a 390 px phone shot of the menu-only screen.Generated by Claude Code